#include "httplib.h"

#define SERVER_IP "118.31.65.50"
#define SERVER_PORT 8888
int main()
{
    httplib::Client client(SERVER_IP, SERVER_PORT);//构建一个客户端类

    auto res1 = client.Get("/hi");
    std::cout << res1->status << std::endl;
    std::cout << res1->body << std::endl;

    httplib::MultipartFormData item;
    item.name = "file";//字段名称
    item.filename = "holle.txt";//文件名称
    item.content = "Holle world!";
    item.content_type = "text/plain";

    httplib::MultipartFormDataItems items;
    items.push_back(item);//同时上传多个文件

    auto res3 = client.Post("/multipart", items);//返回值一个智能指针管理的Response
    std::cout << res3->status << std::endl;
    std::cout << res3->body << std::endl;

    return 0;
}